---
order: 1
title: Solid Color
type: Graphics
group: Background
label: Graphics/Background
---

When the background type of the scene is set to solid color, the rendering area of the canvas will be filled with the corresponding solid color background before the camera renders.

## Setting a Solid Color Background

Navigate to **[Hierarchy Panel](/en/docs/interface/hierarchy)** -> **Select Scene** -> **[Inspector Panel](/en/docs/interface/inspector)** -> **Background Section** and set **Mode** to **Solid Color**, then choose the desired background color. You will see the background of the scene change in real-time.

<Image src="https://mdn.alipayobjects.com/huamei_yo47yq/afts/img/A*RDQ-T5h7YdEAAAAAAAAAAAAADhuCAQ/original" />

Similarly, you can also set it in the script with the following code:

```typescript
// 获取当前场景的背景实例
const background = scene.background;
// 设置背景类型为纯色
background.mode = BackgroundMode.SolidColor;
// 设置特定的背景色
background.solidColor.set(0.25, 0.25, 0.25, 1.0);
// 设置为(0,0,0,0) 可以透出网页背景
background.solidColor.set(0, 0, 0, 0);
```

## Properties

It is important to note that the relevant properties of the background are all in the `background` property of the scene. After obtaining this property instance, you need to modify the relevant properties for them to take effect.

| Property   | Function          |
| :--------- | :---------------- |
| solidColor | Sets the background color |

